<?php
class Index extends CI_Model {
	 protected $site_title = '';
	 function __construct() {
		parent::__construct ();
		$this->load->helper('cookie');
	}
	//change language
	function changeL($args){
		$l = isset($args['l'])?$args['l']:'en';
		delete_cookie('lz_l','.lzchinese.com');
		set_cookie('lz_l', $l,300*24*3600, '.lzchinese.com'); 
		die($l);
		exit;
	}
	public function m_index(){
		$language = get_cookie('lz_l');
		if(empty($language)){
			$language = $this->config->item('languages');
		}
		$params[] = $language = strtolower($language);
		$this->load->library('simple_cache', $params);
		 
		$data['naviTits'] = $this->simple_cache->getItem('naviTits');
		$data['subNaviTits'] = $this->simple_cache->getItem('subNaviTits');
		$data['site_title'] = $this->config->item('site_title');
		$data['tab'] = 'index';
		//focus
		$data['indexfocus'] = $this->simple_cache->getItem('indexfocus');
		//middle
		$data['indexmiddle'] = $this->simple_cache->getItem('indexmiddle');
		//友情链接
		$data['flink'] = $this->simple_cache->getItem('flink');
		//每日一句
		$data['dailyone'] = $this->simple_cache->getItem('dailyone');
		
		//trcjs
		$data['trcjs'] = $this->simple_cache->getItem('trcjs');
		$this->load->vars($data);
	}
	
	function __destruct() {
	
	}
}

?>